package entity;

public class Result<T> {
    public boolean flag;
    private Integer code;
    private String message;
    private T data;

    public Result(boolean flag,Integer code,String message,Object data){
        this.code = code;
        this.flag = flag;
        this.message = message;
        this.data = (T) data;
    }

    public Result(boolean flag,Integer code,String message){
        this.code = code;
        this.flag = flag;
        this.message = message;
    }

    public Result(){
        this.flag = true;
        this.code = StatusCode.OK;
        this.message = "操作成功!";
    }
}
